<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Sistem Informasi Manajemen Desa - <?=$this->config->item('kota')?></title>
	<link rel="shortcut icon" href="<?php echo base_url();?>asset/images/favicon.ico"> 

	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<link href="<?=base_url();?>asset/css/bootstrap.min.css" rel="stylesheet">
	<link href="<?=base_url();?>asset/css/bootstrap-responsive.min.css" rel="stylesheet">
	<!--<link href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600" rel="stylesheet">-->
	<link href="<?=base_url();?>asset/css/font-awesome.css" rel="stylesheet">
	<link href="<?=base_url();?>asset/css/style.css" rel="stylesheet">
	<link href="<?=base_url();?>asset/css/pages/dashboard.css" rel="stylesheet">
	
	<link rel="stylesheet" type="text/css" href="<?=base_url();?>asset/easyui/themes/bootstrap/easyui.css" />
	<link rel="stylesheet" type="text/css" href="<?=base_url();?>asset/easyui/themes/icon.css" />
</head>
<body>
	
	<style type="text/css">
		#fm{
			margin:0;
			padding:10px 30px;
		}
		.ftitle{
			font-size:14px;
			font-weight:bold;
			color:#666;
			padding:5px 0;
			margin-bottom:10px;
			border-bottom:1px solid #ccc;
		}
		.fitem{
			margin-bottom:5px;
		}
		.fitem label{
			display:inline-block;
			min-width:30px;
		}
		
	  .fsearch{
		background:#fafafa;
		border-radius:5px;
		-moz-border-radius:0px;
		-webkit-border-radius: 5px;
		-moz-box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.2);
		-webkit-box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.2);
		filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2,MakeShadow=false,ShadowOpacity=0.2);
		margin-bottom:0px;
		border: 1px solid #99BBE8;
	    color: #15428B;
	    font-size: 12px;
	    position: relative;
	  }
	  .fsearch div{
		background:url('<?=base_url();?>public/css/themes/gray/images/panel_title.gif') repeat-x;
		height:200%;
		border-bottom: 1px solid #99BBE8;
		color:#15428B;
		font-size:10pt;
		text-transform:uppercase;
	    font-weight: bold;
	    padding: 3px 5px 0px 5px;
	    position: relative;
	  }
	  .fsearch table{
	    padding: 8px;
	  }
	  .fsearch label{
		display:inline-block;
		width:60px;
	  }
		.fitemArea{
			margin-bottom:5px;
			text-align:left;
			/* border:1px solid blue; */
		}
		.fitemArea label{
			display:inline-block;
			width:84px;
			margin-bottom:5px;
		}
		
		
		.tbl {
			width: 100%;
			padding: 0;
			margin: 0;
		}
		
		.tbl th{
			font: normal 12px;
			color: #4f6b72;
			border-right: 1px solid #C1DAD7;
			border-bottom: 1px solid #C1DAD7;
			border-top: 1px solid #C1DAD7;
			border-left: 1px solid #C1DAD7;
			/*text-align: left;*/
			padding: 2px 2px 3px 4px;
			margin:0;
			background: #CAE8EA url(<?=base_url();?>asset/images/th.png) repeat-x;
		}
		
		.tbl td{
			border-right: 1px solid #C1DAD7;
			border-left: 1px solid #C1DAD7;
			border-top: 1px solid #C1DAD7;
			border-bottom: 1px solid #C1DAD7;
			padding: 3px 3px 3px 5px;
			margin:0;
		}
		
		.tbl tr{
			margin:0;
		}
	</style>
	
	
	<div class="navbar navbar-fixed-top">
	  <div class="navbar-inner">
	    <div class="container"> 
	      <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
	        <span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span> 
	      </a>
	      <a class="logo" href="">LOGO</a>
	      <a class="brand" href="">Sistem Informasi Manajemen Desa</a>
	      <div class="nav-collapse">
	        <ul class="nav pull-right">
	          <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><i
	                            class="icon-user"></i> Administrator <b class="caret"></b></a>
	            <ul class="dropdown-menu">
	              <li><a href="#" >Profile</a></li>
	              <li><a href="<?=base_url()?>auth/logout">Logout</a></li>
	            </ul>
	          </li>
	        </ul>
	        <!--form class="navbar-search pull-right">
	          <input type="text" class="search-query" placeholder="Search">
	        </form-->
	      </div>
	      <!--/.nav-collapse --> 
	    </div>
	    <!-- /container --> 
	  </div>
	  <!-- /navbar-inner --> 
	</div>
	<!-- /navbar -->
	<div class="subnavbar">
	  <div class="subnavbar-inner">
	    <div class="container">
	      <ul class="mainnav">
	      	<?php
	      		$menu = $this->mdl_auth->createmenu();
	      		
	      		foreach ($menu as $row) {
	      			if($row['children']){
	      	?>
						<li id="menu<?=$row['id']?>" class="dropdown"><a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"> <i class="<?=$row['icon']?>"></i><span><?=$row['text']?></span><b class="caret"></b></a>
				          <ul class="dropdown-menu">
			<?
						foreach ($row['children'] as $r) {
			?>
							<li><a href="#" onclick="loadContent('<?=$r['url']?>'); set_active_menu('<?=$r['parent']?>')"><?=$r['text']?></a></li>
			<?
						}
			?>
				          </ul>
				        </li>
	      	<?
	      			}else{
	      	?>
						<li id="menu<?=$row['id']?>" class="dropdown <?=$row['id']==1?'active':'';?>"><a href="#" onclick="loadContent('<?=$row['url']?>'); set_active_menu('<?=$row['parent']?>')"><i class="<?=$row['icon']?>"></i><span><?=$row['text']?></span> </a> </li>
	      	<?
	      			}
	      		}
	      	?>
	      </ul>
	    </div>
	    <!-- /container --> 
	  </div>
	  <!-- /subnavbar-inner --> 
	</div>
	<!-- /subnavbar -->
	<div class="main">
	  <div class="main-inner">
	    <div class="container" id="main">
	      
	    </div>
	    <!-- /container --> 
	  </div>
	  <!-- /main-inner --> 
	</div>
	<!-- /main -->
	<div class="footer">
	  <div class="footer-inner">
	    <div class="container">
	      <div class="row">
	        <div class="span12"> &copy; 2015 <a href="#"><?=$this->config->item('kota')?> - <?=$this->config->item('prov')?></a>. </div>
	        <!-- /span12 --> 
	      </div>
	      <!-- /row --> 
	    </div>
	    <!-- /container --> 
	  </div>
	  <!-- /footer-inner --> 
	</div>
	<!-- /footer --> 
	<!-- Le javascript
	================================================== --> 
	<!-- Placed at the end of the document so the pages load faster --> 
	<script src="<?=base_url();?>asset/js/jquery-1.7.2.min.js"></script> 
	<script src="<?=base_url();?>asset/js/excanvas.min.js"></script> 
	<script src="<?=base_url();?>asset/js/bootstrap.js"></script>
	<script language="javascript" type="text/javascript" src="<?=base_url();?>asset/js/full-calendar/fullcalendar.min.js"></script>
	<script type="text/javascript" src="<?=base_url();?>asset/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="<?=base_url();?>asset/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="<?=base_url();?>asset/easyui/plugins/jquery.datagrid-groupview.js"></script>
	<script type="text/javascript" src="<?=base_url();?>asset/easyui/plugins/jquery.datagrid-filter.js"></script>
	<script type="text/javascript" src="<?=base_url();?>asset/easyui/plugins/jquery.datagrid-detailview.js"></script>
	<script type="text/javascript" src="<?=base_url();?>asset/js/jquery.price_format.2.0.min.js"></script>
	<script type="text/javascript" src="<?=base_url();?>asset/js/Chart.js"></script>
	 
	<script src="<?=base_url();?>asset/js/base.js"></script> 

	<script>		
		base_url = '<?=base_url();?>';
		
		function loadContent(sourceUrl) {
			$("#main").load(base_url+sourceUrl);
		}

		function addCommas(nStr)
		{
			nStr += '';
			x = nStr.split('.');
			x1 = x[0];
			x2 = x.length > 1 ? '.' + x[1] : '';
			var rgx = /(\d+)(\d{3})/;
			while (rgx.test(x1)) {
				x1 = x1.replace(rgx, '$1' + '.' + '$2');
			}
			return x1 + x2;
		}

		set_active_menu = function(menu_parent){
			// remove active menu
			$('.dropdown').each(function() {
				$(this).removeClass('active');
			});
			//alert(menu_parent);
			if(menu_parent != 0){
				$('#menu'+menu_parent).addClass('active');
			}else{
				$('#menu1').addClass('active');
			}

		}

		$(document).ready(function(){			
			check_login = function(){
				$.ajax({
				  url: base_url+"auth/cekstatuslogin",
				  data: { },
				  success : function(data, textStatus){
					//alert(data);
					if (data=="0" || data==""){
						window.location.replace(base_url+"auth/login");
					}
				  },
				  complete: function(xmlHttp) {
					// xmlHttp is a XMLHttpRquest object
					//if (xmlHttp.status==200) window.location.replace(base_url+"security/login");
				  }
				});
			}
			
			// cek login
			jQuery(document).ajaxStart(function(){
				check_login();
			});
			
			// format date picker
			DateFormatter = function(date){
				var y = date.getFullYear();
				var m = date.getMonth()+1;
				var d = date.getDate();
				//return y+'/'+(m<10?('0'+m):m)+'/'+(d<10?('0'+d):d);
				return (d<10?('0'+d):d) + '/' + (m<10?('0'+m):m) + '/' + y;
			}
			DateParser = function(s){
				if (!s) return new Date();
				var ss = (s.split('/'));
				var y = parseInt(ss[2],10);
				var m = parseInt(ss[1],10);
				var d = parseInt(ss[0],10);
				if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
					return new Date(y,m-1,d);
				} else {
					return new Date();
				}
			}
			
			// inisialisasi dialog box
			$('#dialog').dialog({
				style:{background:'#EBF4FB'}
			});

			// popup windows
			popupwindow = function(url, title, w, h) {
			  var left = (screen.width/2)-(w/2);
			  var top = (screen.height/2)-(h/2);
			  return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
			} 
			
			// init
			check_login();

			var lineChartData = {
	            labels: ["January", "February", "March", "April", "May", "June", "July"],
	            datasets: [
					{
					    fillColor: "rgba(220,220,220,0.5)",
					    strokeColor: "rgba(220,220,220,1)",
					    pointColor: "rgba(220,220,220,1)",
					    pointStrokeColor: "#fff",
					    data: [65, 59, 90, 81, 56, 55, 40]
					},
					{
					    fillColor: "rgba(151,187,205,0.5)",
					    strokeColor: "rgba(151,187,205,1)",
					    pointColor: "rgba(151,187,205,1)",
					    pointStrokeColor: "#fff",
					    data: [28, 48, 40, 19, 96, 27, 100]
					}
				]

	        }


	        var barChartData = {
	            labels: ["January", "February", "March", "April", "May", "June", "July"],
	            datasets: [
					{
					    fillColor: "rgba(220,220,220,0.5)",
					    strokeColor: "rgba(220,220,220,1)",
					    data: [65, 59, 90, 81, 56, 55, 40]
					},
					{
					    fillColor: "rgba(151,187,205,0.5)",
					    strokeColor: "rgba(151,187,205,1)",
					    data: [28, 48, 40, 19, 96, 27, 100]
					}
				]

	        }    


			loadContent("main/dashboard", function() {
				var myLine = new Chart(document.getElementById("area-chart").getContext("2d")).Line(lineChartData);
			});

		}); 
	</script><!-- /Calendar -->
	
	<!-- AREA untuk Form Add/EDIT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>  -->
	<div id="dialog" class="easyui-dialog" style="width:400px;height:150px;" closed="true" buttons="#dlg-buttons"></div>
	<div id="dialogDetail" class="easyui-dialog" style="width:400px;height:150px" closed="true">
		
	</div>
	<div id="dlg-buttons">
		<a href="#" class="easyui-linkbutton" iconCls="icon-save" onclick="saveData()">Simpan</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dialog').dialog('close')">Batal</a>
	</div>
	
	<!-- TAMBAHAN DIALOG DETAIL -->
	<div id="dialog_a" class="easyui-dialog" style="width:400px;height:150px;" closed="true" buttons="#dlga-buttons"></div>
	<!--div id="dialogDetail" class="easyui-dialog" style="width:400px;height:150px" closed="true">
		
	</div-->
	<div id="dlga-buttons">
		<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dialog_a').dialog('close')">Batal</a>
	</div>
</body>
</html>